<?php

namespace app\api\controller;

use app\common\controller\Api;
use app\api\service\OrderService;

class Order extends Api
{
    protected $noNeedLogin = [];
    protected $noNeedRight = ['*'];

    /**
     * 下单路费
     *
     */
    public function travel_expenses()
    {
        $data = $this->request->post();
        $res = OrderService::getTravelExpenses($data);
        return json($res);
    }

    /**
     * 可用优惠劵
     *
     */
    public function coupon_lists()
    {
        $data = $this->request->post();
        $res = OrderService::getCouponLists($data);
        return json($res);
    }

    /**
     * 查看委托书
     *
     */
    public function look_contract()
    {
        $data = $this->request->post();
        $res = OrderService::LookContract($data);
        return json($res);
    }

    public function look_contracts()
    {
        $data = $this->request->post();
        $res = OrderService::LookContracts($data);
        return json($res);
    }

    /**
     * 签署委托书
     *
     */
    public function sign_contract()
    {
        $data = $this->request->post();
        $res = OrderService::SignContract($data);
        return json($res);
    }

    /**
     * 新增
     *
     */
    public function add()
    {
        $data = $this->request->post();
        $res = OrderService::add($data);
        return json($res);
    }

    /**
     * 支付
     *
     */
    public function pay()
    {
        $data = $this->request->post();
        $res = OrderService::pay($data);
        return json($res);
    }

    /**
     * 订单列表
     *
     */
    public function lists()
    {
        $data = $this->request->post();
        $res = OrderService::lists($data);
        return json($res);
    }

    /**
     * 详情
     * state "-1":__('待付款'),"0":__('待接单'),"1":__('服务中'),"2":__('已完成'),"7":__('已取消')
     */
    public function detail()
    {
        $data = $this->request->post();
        $res = OrderService::detail($data);
        return json($res);
    }

    /**
     * 取消
     *
     */
    public function cancel()
    {
        $data = $this->request->post();
        $res = OrderService::cancel($data);
        return json($res);
    }



    /**
     * 管家位置
     *
     */
    public function steward_location()
    {
        $data = $this->request->post();
        $res = OrderService::getStewardLocation($data);
        return json($res);
    }

    /**
     * 学生照片
     *
     */
    public function student_photo()
    {
        $data = $this->request->post();
        $res = OrderService::getStudentPhoto($data);
        return json($res);
    }

    /**
     * 开始服务
     *
     */
    public function service()
    {
        $data = $this->request->post();
        $res = OrderService::serviceOrder($data);
        return json($res);
    }

    /**
     * 确认完成
     *
     */
    public function confirm()
    {
        $data = $this->request->post();
        $res = OrderService::confirmOrder($data);
        return json($res);
    }

    /**
     * 删除
     *
     */
    public function delete()
    {
        $data = $this->request->post();
        $res = OrderService::deleteOrder($data);
        return json($res);
    }



}